﻿<Windows:BookvarToolWindow
	x:Class="BookvarWpf.Windows.SwitchMaps"
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:aw="clr-namespace:Assergs.Windows;assembly=Assergs.Windows"
	xmlns:bookvar="clr-namespace:Bookvar.UI;assembly=Bookvar.UI"
	xmlns:local="clr-namespace:BookvarWpf"
	xmlns:Windows="clr-namespace:BookvarWpf.Windows;assembly="
	Style="{DynamicResource {x:Type aw:ToolWindow}}"
	Background="DarkBlue"
	Height="265"
	>

	<Grid>

		<Grid.ColumnDefinitions>
			<ColumnDefinition Width="0.38*"/>

			<ColumnDefinition Width="0.62*"/>
		</Grid.ColumnDefinitions>
		<Grid.RowDefinitions>
			<RowDefinition Height="0.17*"/>
			<RowDefinition Height="0.063*"/>
			<RowDefinition Height="0.767*"/>
		</Grid.RowDefinitions>

		<Grid.Resources>


			<Style x:Key="ListBoxTemplate" TargetType="{x:Type ListBox}">
				<Setter Property="Template">
					<Setter.Value>
						<ControlTemplate TargetType="{x:Type ListBox}">
							<Border Background="{TemplateBinding Panel.Background}"
									BorderBrush="{TemplateBinding Border.BorderBrush}"
									BorderThickness="{TemplateBinding Border.BorderThickness}">

								<ScrollViewer HorizontalScrollBarVisibility="Auto">
									<StackPanel x:Name="StackPanel1" IsItemsHost="True"
									   Orientation="Horizontal"/>
								</ScrollViewer>
							</Border>
						</ControlTemplate>
					</Setter.Value>
				</Setter>
			</Style>


			<Style TargetType="ListBoxItem">

				<Setter Property="Opacity" Value="0.3" />
				<Setter Property="MaxHeight" Value="195" />
				<Setter Property="MaxWidth" Value="195" />
				<Setter Property="Padding" Value="3" />

				<Setter Property="Template">

					<Setter.Value>
						<ControlTemplate TargetType="{x:Type ListBoxItem}">
							<Border SnapsToDevicePixels="true" x:Name="Bd" Background="{TemplateBinding Background}"
				  BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}"
				  Padding="{TemplateBinding Padding}" CornerRadius="4">
								<ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
					HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
					VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
							</Border>
						</ControlTemplate>
					</Setter.Value>
				</Setter>
				<Style.Triggers>
					<Trigger Property="IsSelected" Value="True">
						<Trigger.Setters>
							<Setter Property="Opacity"  Value="1.0" />
							<Setter Property="BorderBrush" Value="#feca00" />
							<Setter Property="BorderThickness" Value="4,4,4,4" />

						</Trigger.Setters>
					</Trigger>
				
				</Style.Triggers>
			</Style>

		</Grid.Resources>
		<StackPanel  Grid.ColumnSpan="2" Grid.RowSpan="3" Background="{StaticResource RichTextBoxBackgroundBrush}">
		
			<StackPanel Orientation="Vertical">

				<ListBox x:Name="lstMaps"  ScrollViewer.CanContentScroll="True"
						 Style="{StaticResource ListBoxTemplate}" HorizontalAlignment="Left"
						 Margin="10,2,15,6" VerticalAlignment="Top" Height="220" Width="800"
						 Background="Transparent">
					<ListBox.Resources>
						<DataTemplate DataType="{x:Type local:Picture}">
							<Image Source="{Binding Uri}" />
						</DataTemplate>
					</ListBox.Resources>
				</ListBox>

			</StackPanel>




		</StackPanel>

	</Grid>

</Windows:BookvarToolWindow>
